package saying.client;


import notebook.client.Notebook;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.RootPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Saying implements EntryPoint {

	Notebook nb;
	public void onModuleLoad() {
		RootPanel rootPanel = RootPanel.get();
		rootPanel.setSize("100%", "100%");
		Button write = getWriteButton();
		rootPanel.add(write);
	}
	
	private Button getWriteButton(){
		Button write = new Button("写笔记");
		write.addClickHandler(new ClickHandler(){
			public void onClick(ClickEvent event) {
				if(nb==null) nb = new Notebook();
				nb.show();
			}});
		return write;
	};

}
